PROJECT(STVM C)

cmake_minimum_required(VERSION 2.8) 

SET(MAX_INDEX_LEN 64 )
SET(MAX_FILED_NUM 64 )


add_definitions(-DMAX_INDEX_LEN=${MAX_INDEX_LEN} -DMAX_FILED_NUM=${MAX_FILED_NUM})

INCLUDE_DIRECTORIES(
include
)

add_library(stvm STATIC
src/tree.c
src/sem.c
src/msg.c
src/tcp.c
src/str.c
src/list.c
src/conf.c
src/queue.c
src/func.c
)


set(EXTRA_LIB
readline m c dl rt pthread
)

add_executable(stvmbin src/stvm.c)
target_link_libraries(stvmbin stvm ${EXTRA_LIB})
set_target_properties(stvmbin  PROPERTIES OUTPUT_NAME stvm ) 

add_executable(detvm  src/detvm.c)
target_link_libraries(detvm  stvm ${EXTRA_LIB})
